<html>
  <head>
    <title>Go</title>
    <script type="text/javascript" src="wgo/wgo.min.js"></script>
    <script type="text/javascript" src="wgo/wgo.player.min.js"></script>
    <link type="text/css" href="wgo/wgo.player.css" rel="stylesheet"/>
  </head>
  <body>
    <form ENCTYPE="multipart/form-data" method="post">
      <input name="file" type="file"/>
      <input type="submit" value="upload"/>
    </form>
    <div id="player" style="width: 700px">
      Sorry, your browser doesn't support WGo.js. Download SGF <a href="game.sgf">directly</a>.
    </div>
  </body>
</html>


<!-- Activating a player using javascript -->
<script type="text/javascript">
function getParameterByName(name, url) 
{
    if (!url) 
      url = window.location.href;

    name = name.replace(/[\[\]]/g, "\\$&");

    var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url);

    if (!results) 
      return null;

    if (!results[2]) 
      return '';
    
    return decodeURIComponent(results[2].replace(/\+/g, " "));
}

var elem = document.getElementById("player");

var player = new WGo.BasicPlayer(elem, {
    sgfFile: getParameterByName('file') + ".sgf",
    move: 50
});
</script>